#include <jni.h>
#include <stdio.h>
#include <memory.h>
#include <stdlib.h>
#include <gsl/gsl_matrix.h>

#include "ArrayHandler.h"
#define LLEN 10

 JNIEXPORT jobjectArray JNICALL 
               Java_ArrayHandler_returnArray
  (JNIEnv *env, jobject jobj){

    jobjectArray ret;
    int i;

    char *message[5]= {"first", 
	"second", 
	"third", 
	"fourth", 
	"fifth"};

    ret= (jobjectArray)env->NewObjectArray(5,
         env->FindClass("java/lang/String"),
         env->NewStringUTF(""));

    for(i=0;i<5;i++) {
        env->SetObjectArrayElement(
		ret,i,env->NewStringUTF(env, message[i]));
    }
    return(ret);
  }
